Three spec failures, all datetime-related
-
foleyflex
Happened to me as well...a couple of workarounds: 1. Adding the :db to the remember_token_expires_at: field of the quentin: user fixture (users.yml) is VERY important. In some installs of mysql I tested, this would cause all model specs to fail (Could be version of mysql or how its configured...haven't determined).
-
For the failure on line 211 above, I switched from using '==' to using should.eql? time. The == seems to evaluate the output, the eql? seems to compare actual time values. This is important because after storing the time value in the quentin object, it spits it back in rfc822 format on output.
-
I've been having issues with the between? method in rspec. It seems to fail in some instances when called programatically, but when I test it in the console, it never fails...possible minor deviations in ruby acquiring system time (I'm on a Windows box). I worked around by outputting the datetime stamps as a date...testing the cookie to expire to the second wasn't that important for me.
-
-
foleyflex
Wow...my comments got munged..oh well, the point it made.
-
Ben Kimball
Ah, thanks foleyflex.
The problem is definitely in the date comparison algorithm; I think between? must use '>', '<', and/or '==' internally.
I managed to fix the test failures (in a kind of fragile way) with this:
it 'remembers me for one week' do timeout = 1.week.from_now.utc members(:quentin).remember_me_for 1.week members(:quentin).remember_token.should_not be_nil members(:quentin).remember_token_expires_at.should_not be_nil members(:quentin).remember_token_expires_at.should.eql? timeout end
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
